import { _decorator, Node } from "cc";
import ComponentBase from "../engine/ComponentBase";

const { ccclass, property } = _decorator;

@ccclass("component/LoadingIcon")
export class LoadingIcon extends ComponentBase {

    private icon: Node;

    onEnable() {
        this.icon = this.findChild(this.node, "icon")
        this.icon.active = true
    }

    update() {
        if (this.icon && this.icon.active) {
            this.icon.angle -= 8;
        }
    }

    onDisable(): void {
        this.icon.active = false
    }
}

